home *** CD-ROM | disk | FTP | other *** search
/ Graphics Plus / Graphics Plus.iso / general / modelers / geomview / source.lha / Geomview / makefiles / Makedefs.SUBDIRS < prev    next >
Text File  |  1992-11-17  |  4KB  |  119 lines

  1. # These macros are used for descending into various subdirectories.
  2. # The general idea of these macros is that we want make to descend into
  3. # every subdirectory of the current directory except for certain ones
  4. # that are skipped.  The different macros have different criteria for
  5. # determining which ones are skipped.
  6. # In all cases the "listdirs" script in the tools directory is used to
  7. # generate a list of directories to consider.  This script returns all
  8. # subdirs of the current dir except certain ones that we never want to
  9. # go into (see the comments in that script for details).
  10. # In addition, all the macros below test to make sure that a directory
  11. # contains a Makefile (with a capital M) before desending into it.
  12. ########################################################################
  13.  
  14. # skip none --- go into every subdir meeting the above conditions:
  15.  
  16. DO_DIRS =                        \
  17.     ( dirs=`${GEOM}/tools/listdirs` ;        \
  18.       for dir in $$dirs ; do            \
  19.         if [ -d $$dir -a -f $$dir/Makefile ] ; then    \
  20.           echo "\tcd $$dir ; ${RMAKE} $@" ;        \
  21.           ( cd $$dir ; ${RMAKE} $@ ) ;        \
  22.         fi ;                    \
  23.       done )
  24.  
  25. ########################################################################
  26.  
  27. # Only go into directories appropriate for this machine.
  28. # Specifically, if a directory has object (O.*) subdirs, only go into
  29. # it if there it has an object subdir for this machine (named
  30. # O.${MACHTYPE}).  Also, only go into object subdirs for this machine.
  31.  
  32. DO_DIRS_THIS_MACH =                            \
  33.     ( dirs=`${GEOM}/tools/listdirs` ;                \
  34.       for dir in $$dirs ; do                    \
  35.         case $$dir in                        \
  36.           O.*)                            \
  37.             if [ $$dir = O.${MACHTYPE} -a -f $$dir/Makefile ] ; then \
  38.               echo "\tcd $$dir ; ${RMAKE} $@" ;            \
  39.               ( cd $$dir ; ${RMAKE} $@ ) ;                \
  40.             fi                            \
  41.         ;;                            \
  42.           *)                            \
  43.         if [ -d $$dir/O.${MACHTYPE} -o                \
  44.             "`cd $$dir; echo O.*`" = "O.*" ] ; then        \
  45.           if [ -f $$dir/Makefile ] ; then            \
  46.                 echo "\tcd $$dir ; ${RMAKE} $@" ;            \
  47.                 ( cd $$dir ; ${RMAKE} $@ ) ;            \
  48.           fi ;                            \
  49.         fi ;                             \
  50.         ;;                            \
  51.         esac ;                            \
  52.       done )
  53.  
  54. ########################################################################
  55.  
  56. # Only go into directories appropriate for this machine (i.e. same as
  57. # DO_DIRS_THIS_MACH), but don't go into any object directories.
  58.  
  59. DO_DIRS_THIS_MACH_NO_OBJ =                        \
  60.     ( dirs=`${GEOM}/tools/listdirs` ;                \
  61.       for dir in $$dirs ; do                    \
  62.         case $$dir in                        \
  63.           O.*)                            \
  64.         ;;                            \
  65.           *)                            \
  66.         if [ -d $$dir/O.${MACHTYPE} -o                \
  67.                 "`cd $$dir; echo O.*`" = "O.*" ]; then    \
  68.           if [ -f $$dir/Makefile ] ; then            \
  69.                 echo "\tcd $$dir ; ${RMAKE} $@" ;            \
  70.                 ( cd $$dir ; ${RMAKE} $@ ) ;            \
  71.           fi ;                            \
  72.         fi ;                             \
  73.         ;;                            \
  74.         esac ;                            \
  75.       done )
  76.  
  77. ########################################################################
  78.  
  79. # Only go into source directories --- skip all object directories.
  80. # This goes into all source directories, regardless of machine type.
  81.  
  82. DO_DIRS_NO_OBJ =                    \
  83.     ( dirs=`${GEOM}/tools/listdirs` ;        \
  84.       for dir in $$dirs ; do            \
  85.         case $$dir in                \
  86.           O.*)                    \
  87.         ;;                    \
  88.           *)                    \
  89.         if [ -f $$dir/Makefile ] ; then        \
  90.               echo "\tcd $$dir ; ${RMAKE} $@" ;    \
  91.               ( cd $$dir ; ${RMAKE} $@ ) ;        \
  92.         fi ;                    \
  93.         ;;                    \
  94.         esac ;                    \
  95.       done )
  96.  
  97.  
  98. ########################################################################
  99.  
  100. # just in case I forgot to change some makefiles:
  101.  
  102. DO_DIRS_NO_MACH = \
  103.   @( echo "" ; \
  104.      echo "" ; \
  105.      echo "" ; \
  106.      echo "WARNING: obsolete make macro DO_DIRS_NO_MACH called" ; \
  107.      echo "  by make in directory `pwd`.  The name of this macro" ; \
  108.      echo "  has been changed to DO_DIRS_NO_OBJ.  Please tell" ; \
  109.      echo "  mbp@geom.umn.edu about this." ; \
  110.      echo "" ; \
  111.      echo "" ; \
  112.      echo "" ; ) ; \
  113.   ${DO_DIRS_NO_OBJ}
  114.